<template>
	<view class="apt-container">
		<CustomNav :nav-info="navInfo" />
		<view class="apt-container-top">
			<view class="apt-container-banner">
				<image style="width:100%" src="https://ltzn.oss-cn-zhangjiakou.aliyuncs.com/ren_cai_ji_tuan/apartment/banner.png" mode="aspectFill"></image>
			</view>
		</view>
		<view class="apt-container-content">
			<view class="search">
				<view class="areaType" style="width: 15%;">
					全区 <uni-icons type="bottom" size="10"></uni-icons>
				</view>
				<uni-search-bar style="width: 75%;" placeholder="你想住在哪？搜索公寓" @confirm="" @input="" />
				<uni-icons style="width: 10%;" type="search"></uni-icons>
			</view>
			<view class="list mt-20">
				<view class="apt-item" v-for="(item,idx) in aptList" :key="idx" @click.native="go2Detail">
					<view class="apt-item-avatar">
						<image style="width:100%; height: 100%;" :src="item.avatar" mode="scaleToFill"></image>
					</view>
					<view class="apt-item-info">
						<view class="title">{{ item.title }}</view>
						<view class="money">{{ item.money }}</view>
						<view class="text-color">{{ item.address }}</view>
						<view class="text-color">{{ item.service }}</view>
						<view class="text-color mt-20">
							<uni-tag v-for="(tag, idx1) in item.tags" :key="tag" :class="{'ml-10': idx1 > 0}" custom-style="background-color: #F6F7F9; border-color: #F6F7F9; color: #666768;" :text="tag" />
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import CustomNav from '../../components/CustomNav/index.vue'
	export default {
		components: {
			CustomNav
		},
		data() {
			return {
				navInfo: {
					bg_color: 'transparent',
					color: "#fff",
					name: '公寓'
				},
				aptList: [{
					avatar: 'https://ltzn.oss-cn-zhangjiakou.aliyuncs.com/ren_cai_ji_tuan/apartment/banner.png',
					title: '尔家公寓(广益食科园店)',
					money: '2400.00元/月起',
					address: '距离5.5km | 尔家公寓',
					service: '管家: 尔家公寓',
					tags: ['安全监控', '便利店', '带电梯']
				},{
					avatar: 'https://ltzn.oss-cn-zhangjiakou.aliyuncs.com/ren_cai_ji_tuan/apartment/banner.png',
					title: '尔家公寓(广益食科园店)',
					money: '2400.00元/月起',
					address: '距离5.5km | 尔家公寓',
					service: '管家: 尔家公寓',
					tags: ['安全监控', '便利店', '带电梯']
				},{
					avatar: 'https://ltzn.oss-cn-zhangjiakou.aliyuncs.com/ren_cai_ji_tuan/apartment/banner.png',
					title: '尔家公寓(广益食科园店)',
					money: '2400.00元/月起',
					address: '距离5.5km | 尔家公寓',
					service: '管家: 尔家公寓',
					tags: ['安全监控', '便利店', '带电梯']
				},{
					avatar: 'https://ltzn.oss-cn-zhangjiakou.aliyuncs.com/ren_cai_ji_tuan/apartment/banner.png',
					title: '尔家公寓(广益食科园店)',
					money: '2400.00元/月起',
					address: '距离5.5km | 尔家公寓',
					service: '管家: 尔家公寓',
					tags: ['安全监控', '便利店', '带电梯']
				},{
					avatar: 'https://ltzn.oss-cn-zhangjiakou.aliyuncs.com/ren_cai_ji_tuan/apartment/banner.png',
					title: '尔家公寓(广益食科园店)',
					money: '2400.00元/月起',
					address: '距离5.5km | 尔家公寓',
					service: '管家: 尔家公寓',
					tags: ['安全监控', '便利店', '带电梯']
				}]
			}
		},
		methods: {
			go2Detail() {
				uni.navigateTo({
					url: '/pages/apartment/detail'
				})
			}
		}
	}
</script>

<style lang="scss">
.apt-container {
	min-height: 100vh;
	background-color: #F4F6F8;
	.apt-container-content {
		background-color: #fff;
		.search {
			background-color: #fff;
			width: 90%;
			margin: 0 auto;
			margin-top: -50rpx;
			display: flex;
			align-items: center;
			position: relative;
			border-radius: 10rpx;
			.areaType {
				padding: 10rpx;
				display: flex;
				justify-content: center;
				align-items: center;
			}
		}
		.apt-item {
			display: flex;
			&-avatar {
				width: 240rpx;
				height: 200rpx;
				padding: 30rpx;
			}
			&-info {
				margin-left: 20rpx;
				display: flex;
				flex-direction: column;
				justify-content: center;
				.title {
					font-size: 32rpx;
					font-weight: 600;
					color: #292F38;
				}
				.money {
					font-size: 28rpx;
					font-weight: 500;
					color: #0051FF;
				}
				.text-color {
					font-size: 24rpx;
					font-weight: 400;
					color: #717680;
				}
			}
		}
	}
}
</style>
